<?php

$token = "wPzNUYvLpeqYT0pCJ1T2fisDODcXp2p";

require_once 'bootstrap.php';
		$conn = Doctrine_Manager::connection(DSN);
		
		$q2 = Doctrine_Query::create()
		->select('id_usuario')
		->from('login')
		->where('token = ?',$token)->execute();
		
		$id_usuario = $q2[0]['id_usuario'];
		
		
		
		$q = Doctrine_Query::create()
		->select('accion, entrada, salida')
		->from('encriptacion e')
		->innerJoin('e.id_login l')
		->innerJoin('l.id_usuario u')
		->where('u.id_user = ?',$id_usuario)->execute();
		
		
		
		for($i = 0;$i < sizeof($q);$i++){
			$array[$i]['accion'] = $q[$i]['accion'];
			$array[$i]['entrada'] = $q[$i]['entrada'];
			$array[$i]['salida'] = $q[$i]['salida'];
			
		}
		
		print_r(json_encode($array));
		
		
?>